package org.example.ch02.p04;

import java.math.BigDecimal;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextLine()){
            String line= scanner.nextLine().trim();
            if (line.isEmpty()){
                break;
            }
            String [] parts= line.split(" ");
            if (parts.length!=2){
                break;
            }
            String aStr= parts[0];
            String bStr= parts[1];
            BigDecimal a= new BigDecimal(aStr);
            BigDecimal b= new BigDecimal(bStr);
            BigDecimal sum= a.add(b);
            BigDecimal product= a.multiply(b);
            System.out.println(sum.toString());
            System.out.println(product.toString());
        }
        scanner.close();
    }
}
